using Community.CsharpSqlite.Entity;

namespace Community.CsharpSqlite
{
    public partial class BTreeHelper
    {
        /*
    ** 2001 September 15
    **
    ** The author disclaims copyright to this source code.  In place of
    ** a legal notice, here is a blessing:
    **
    **    May you do good and not evil.
    **    May you find forgiveness for yourself and forgive others.
    **    May you share freely, never taking more than you give.
    **
    *************************************************************************
    ** This header file defines the interface that the sqlite B-Tree file
    ** subsystem.  See comments in the source code for a detailed description
    ** of what each interface routine does.
    *************************************************************************
    **  Included in SQLite3 port to C#-SQLite;  2008 Noah B Hart
    **  C#-SQLite is an independent reimplementation of the SQLite software library
    **
    **  SQLITE_SOURCE_ID: 2010-03-09 19:31:43 4ae453ea7be69018d8c16eb8dabe05617397dc4d
    **
    **  $Header: Community.CsharpSqlite/src/Btree_h.cs,v 6604176a7dbe 2010/03/12 23:35:36 Noah $
    *************************************************************************
    */
        //#if !_BTREE_H_
        //#define _BTREE_H_

        /* TODO: This definition is just included so other modules compile. It
    ** needs to be revisited.
    */
        private const int SQLITE_N_BTREE_META = 10;



        /*
    ** Forward declarations of structure
    */
        //typedef struct Btree Btree;
        //typedef struct BtCursor BtCursor;
        //typedef struct BtShared BtShared;
        //typedef struct BtreeMutexArray BtreeMutexArray;


        //int sqlite3BtreeOpen(
        //  string zFilename,       /* Name of database file to open */
        //  sqlite3 db,             /* Associated database connection */
        //  Btree **ppBtree,        /* Return open Btree* here */
        //  int flags,              /* Flags */
        //  int vfsFlags            /* Flags passed through to VFS open */
        //);



        //int sqlite3BtreeClose(Btree*);
        //int sqlite3BtreeSetCacheSize(Btree*,int);
        //int sqlite3BtreeSetSafetyLevel(Btree*,int,int);
        //int sqlite3BtreeSyncDisabled(Btree*);
        //int sqlite3BtreeSetPageSize(Btree *p, int nPagesize, int nReserve, int eFix);
        //int sqlite3BtreeGetPageSize(Btree*);
        //int sqlite3BtreeMaxPageCount(Btree*,int);
        //int sqlite3BtreeSecureDelete(Btree*,int);
        //int sqlite3BtreeGetReserve(Btree*);
        //int sqlite3BtreeSetAutoVacuum(Btree , int);
        //int sqlite3BtreeGetAutoVacuum(Btree );
        //int sqlite3BtreeBeginTrans(Btree*,int);
        //int sqlite3BtreeCommitPhaseOne(Btree*, string zMaster);
        //int sqlite3BtreeCommitPhaseTwo(Btree*);
        //int sqlite3BtreeCommit(Btree*);
        //int sqlite3BtreeRollback(Btree*);
        //int sqlite3BtreeBeginStmt(Btree*);
        //int BTreeHelper.BtreeCreateTable(Btree*, int*, int flags);
        //int sqlite3BtreeIsInTrans(Btree*);
        //int sqlite3BtreeIsInReadTrans(Btree*);
        //int sqlite3BtreeIsInBackup(Btree*);
        //void *sqlite3BtreeSchema(Btree , int, void(*)(void *));
        //int sqlite3BtreeSchemaLocked( Btree* pBtree );
        //int sqlite3BtreeLockTable( Btree* pBtree, int iTab, byte isWriteLock );
        //int sqlite3BtreeSavepoint(Btree *, int, int);

        //const char *sqlite3BtreeGetFilename(Btree );
        //const char *sqlite3BtreeGetJournalname(Btree );
        //int sqlite3BtreeCopyFile(Btree *, Btree *);

        //int sqlite3BtreeIncrVacuum(Btree );


        //int BTreeHelper.BtreeDropTable(Btree*, int, int*);
        //int BTreeHelper.BtreeClearTable(Btree*, int, int*);
        //void sqlite3BtreeTripAllCursors(Btree*, int);

        //void sqlite3BtreeGetMeta(Btree *pBtree, int idx, uint *pValue);
        //int sqlite3BtreeUpdateMeta(Btree*, int idx, uint value);



        //int sqlite3BtreeCursor(
        //  Btree*,                              /* BTree containing table to open */
        //  int iTable,                          /* Index of root page */
        //  int wrFlag,                          /* 1 for writing.  0 for read-only */
        //  struct KeyInfo*,                     /* First argument to compare function */
        //  BtCursor pCursor                    /* Space to write cursor structure */
        //);
        //int sqlite3BtreeCursorSize(void);
        //void sqlite3BtreeCursorZero(BtCursor*);

        //int sqlite3BtreeCloseCursor(BtCursor*);
        //int BTreeHelper.BtreeMovetoUnpacked(
        //  BtCursor*,
        //  UnpackedRecord pUnKey,
        //  long intKey,
        //  int bias,
        //  int pRes
        //);
        //int sqlite3BtreeCursorHasMoved(BtCursor*, int*);
        //int BTreeHelper.BtreeDelete(BtCursor*);
        //int BTreeHelper.BtreeInsert(BtCursor*, const void pKey, long nKey,
        //                                  const void pData, int nData,
        //                                  int nZero, int bias, int seekResult);
        //int BTreeHelper.BtreeFirst(BtCursor*, int pRes);
        //int BTreeHelper.BtreeLast(BtCursor*, int pRes);
        //int BTreeHelper.BtreeNext(BtCursor*, int pRes);
        //int BTreeHelper.BtreeEof(BtCursor*);
        //int BTreeHelper.BtreePrevious(BtCursor*, int pRes);
        //int BTreeHelper.BtreeKeySize(BtCursor*, long pSize);
        //int BTreeHelper.BtreeKey(BtCursor*, uint offset, uint amt, void*);
        //const void *BTreeHelper.BtreeKeyFetch(BtCursor*, int pAmt);
        //const void *BTreeHelper.BtreeDataFetch(BtCursor*, int pAmt);
        //int BTreeHelper.BtreeDataSize(BtCursor*, uint pSize);
        //int BTreeHelper.BtreeData(BtCursor*, uint offset, uint amt, void*);
        //void sqlite3BtreeSetCachedRowid(BtCursor*, long);
        //long sqlite3BtreeGetCachedRowid(BtCursor*);

        //char *sqlite3BtreeIntegrityCheck(Btree*, int *aRoot, int nRoot, int, int*);
        //struct Pager *sqlite3BtreePager(Btree*);

        //int sqlite3BtreePutData(BtCursor*, uint offset, uint amt, void*);
        //void sqlite3BtreeCacheOverflow(BtCursor );
        //void sqlite3BtreeClearCursor(BtCursor *);

        //#if !NDEBUG
        //int BTreeHelper.BtreeCursorIsValid(BtCursor*);
        //#endif

        //#if !SQLITE_OMIT_BTREECOUNT
        //int sqlite3BtreeCount(BtCursor *, long *);
        //#endif

        //#if SQLITE_TEST
        //int sqlite3BtreeCursorInfo(BtCursor*, int*, int);
        //void sqlite3BtreeCursorList(Btree*);
        //#endif

#if !SQLITE_OMIT_SHARED_CACHE
//void sqlite3BtreeEnter(Btree*);
//void sqlite3BtreeEnterAll(sqlite3*);
#else
        //# define sqlite3BtreeEnter(X)
        private static void sqlite3BtreeEnter(Btree bt)
        {
        }

        //# define sqlite3BtreeEnterAll(X)
        private static void sqlite3BtreeEnterAll(sqlite3 p)
        {
        }
#endif

#if !(SQLITE_OMIT_SHARED_CACHE) && SQLITE_THREADSAFE
//void sqlite3BtreeLeave(Btree*);
//void sqlite3BtreeEnterCursor(BtCursor*);
//void sqlite3BtreeLeaveCursor(BtCursor*);
//void sqlite3BtreeLeaveAll(sqlite3*);
//void sqlite3BtreeMutexArrayEnter(BtreeMutexArray*);
//void sqlite3BtreeMutexArrayLeave(BtreeMutexArray*);
//void sqlite3BtreeMutexArrayInsert(BtreeMutexArray*, Btree*);
#if !NDEBUG
/* These routines are used inside assert() statements only. */
int sqlite3BtreeHoldsMutex(Btree*);
int sqlite3BtreeHoldsAllMutexes(sqlite3*);
#endif
#else

        //# define sqlite3BtreeLeave(X)
        private static void sqlite3BtreeLeave(Btree X)
        {
        }

        //# define sqlite3BtreeEnterCursor(X)
        private static void sqlite3BtreeEnterCursor(BtCursor X)
        {
        }

        //# define sqlite3BtreeLeaveCursor(X)
        private static void sqlite3BtreeLeaveCursor(BtCursor X)
        {
        }

        //# define sqlite3BtreeLeaveAll(X)
        private static void sqlite3BtreeLeaveAll(sqlite3 X)
        {
        }

        //# define sqlite3BtreeMutexArrayEnter(X)
        private static void sqlite3BtreeMutexArrayEnter(BtreeMutexArray X)
        {
        }

        //# define sqlite3BtreeMutexArrayLeave(X)
        private static void sqlite3BtreeMutexArrayLeave(BtreeMutexArray X)
        {
        }

        //# define sqlite3BtreeMutexArrayInsert(X,Y)
        private static void sqlite3BtreeMutexArrayInsert(BtreeMutexArray X, Btree Y)
        {
        }

        //# define sqlite3BtreeHoldsMutex(X) 1
        private static bool sqlite3BtreeHoldsMutex(Btree X)
        {
            return true;
        }

        //# define sqlite3BtreeHoldsAllMutexes(X) 1
        private static bool sqlite3BtreeHoldsAllMutexes(sqlite3 X)
        {
            return true;
        }
#endif


        //#endif // * _BTREE_H_ */
    }
}